# coding=utf-8
import re
n=int(input())
for i in range(n):
    s=input()
    if re.match(r'^[a-zA-Z_][a-zA-Z0-9_]*$', s):
        print('yes')
    else:
        print('no')